
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import grpc
import hello_pb2, hello_pb2_grpc
 
_HOST = 'localhost'
_PORT = '50051'
 
def run():
    conn = grpc.insecure_channel(_HOST + ':' + _PORT)
    client = hello_pb2_grpc.HelloServiceStub(channel=conn)
    response = client.SayHello(hello_pb2.HelloRequest(name='python!'))
    print("received: " + response.reply)
 
if __name__ == '__main__':
    run()